Video data requires a large storage space to buffer intermediate data during encoding and decoding. Along with the growing high resolution and higher frame rates, as well as more powerful coding techniques are developed to achieve better coding performance, the storage requirement for video encoder and decoder increase significantly. One of the newly developed coding techniques is affine motion prediction and compensation, which effectively tracks more complicated motion such as rotation, zooming, and the deformation of moving objects. Inter frame motion prediction methods applied in the recently developed coding standards such as High Efficiency Video Coding (HEVC) only consider two-dimensional (2D) translational motion, where all the pixels in an area of interest follow the same motion direction and magnitude. Affine motion prediction is capable of describing 2D block rotations and scaling according to a four-parameter affine model. Affine motion prediction is also capable of capturing 2D deformations according to a six-parameter affine model which transforms a square or a rectangle into a parallelogram. There are two major modes for affine motion prediction proposed in the literatures, including affine Merge mode and affine Inter mode. Affine Merge mode allows the inheritance of affine motion information from a spatially neighboring block whereas affine Inter mode constructs several most probable candidates by combining motion information of spatially neighboring blocks. Affine Inter mode is also referred to affine advance motion vector prediction (AMVP) mode.
Motion occurs across pictures along temporal axis can be described by a four-parameter affine motion model as shown in Equation (1). Assuming A(x, y) is an original pixel at location (x, y) under consideration, and A′(x′, y′) is a corresponding reference pixel at location (x′, y′) in a reference picture for the original pixel A(x, y).x′=a0*x+a1*y+a2, andy′=−a1*x+a0*y+a3.  (1)where a0, a1, a2 and a3 are the four parameters in the four-parameter affine motion model.
The motion vector (vx, vy) between this original pixel A(x,y) and its corresponding reference pixel A′(x′,y′) in a block coded in an affine mode is described as:vx=(1−a0)*x−a1*y−a2, andvy=(1−a0)*y+a1*x−a3.  (2)
An exemplary four-parameter affine motion model is shown in FIG. 1A. Two corner pixels 110 and 112 are located at upper-left and upper-right corners of a current block 102, and these two corner pixels are also called control points for the current block 102 in the four-parameter affine motion model. Motion vectors Mv0 and Mv1 of the two control points 110 and 112 map the current block 102 to a reference block 104 in a reference picture. The motion vector field of each pixel A(x,y) in the current block 102 may be derived based on the motion vectors Mv0 and Mv1 of the control points 110 and 112 according to Equation (3).
                    {                                                                              v                  x                                =                                                                                                    (                                                                              v                                                          1                              ⁢                                                                                                                          ⁢                              x                                                                                -                                                      v                                                          0                              ⁢                                                                                                                          ⁢                              x                                                                                                      )                                            w                                        ⁢                    x                                    -                                                                                    (                                                                              v                                                          1                              ⁢                                                                                                                          ⁢                              y                                                                                -                                                      v                                                          0                              ⁢                                                                                                                          ⁢                              y                                                                                                      )                                            w                                        ⁢                    y                                    +                                      v                                          0                      ⁢                                                                                          ⁢                      x                                                                                                                                                                v                  y                                =                                                                                                    (                                                                              v                                                          1                              ⁢                                                                                                                          ⁢                              y                                                                                -                                                      v                                                          0                              ⁢                                                                                                                          ⁢                              y                                                                                                      )                                            w                                        ⁢                    x                                    +                                                                                    (                                                                              v                                                          1                              ⁢                                                                                                                          ⁢                              x                                                                                -                                                      v                                                          0                              ⁢                                                                                                                          ⁢                              x                                                                                                      )                                            w                                        ⁢                    y                                    +                                      v                                          0                      ⁢                                                                                          ⁢                      y                                                                                                                              (        3        )            where (v0x, v0y) represents the motion vector Mv0 at the upper-left corner 110, (v1x, v1y) represents the motion vector Mv1 at the upper-right corner 112, and w represents a width of the current block. For block-based affine motion compensation, when the motion vectors Mv0 and Mv1 of the two control points are decoded, the motion vector of each 4×4 block of the current block 102 can be determined according to Equation (3). In other words, the four-parameter affine motion model for the current block 102 can be specified by the two motion vectors Mv0 and Mv1 at the two control points. Furthermore, while the upper-left corner and the upper-right corner of the block are used as the two control points, other two control points may also be used.
A six-parameter affine motion model can be described by Equation (4). In this model, a total of six parameters a0, a1, a2, b0, b1 and b2 and three control points are used. For each pixel A(x, y), the motion vector (vx, vy) between this pixel A(x, y) and its corresponding reference pixel A′(x′, y′) is shown in Equation (5).x′=a0+a1*x+a2*y, andy′=b0+b1*x+b2*y.  (4)vx=(a1−1)*x+a2*y+a0, andvy=(b2−1)*y+b1*x+b0.  (5)
The motion vector for each pixel predicted by the six-parameter affine motion model is also location dependent. FIG. 1B illustrates an example of affine motion compensation according to the six-parameter affine motion model, where a current block 122 is mapped to a reference block 124 in a reference picture. The correspondences between three corner pixels 130, 132, and 134 of the current block 122 and three corner pixels of the reference block 124 can be determined by the three arrows as shown in FIG. 1B. The six parameters for the affine motion model can be derived based on three known motion vectors Mv0, Mv1, Mv2 of the upper-left, upper-right, and lower-left control points of the current block 122. Parameter derivation for the affine motion model is known in the field and the details are omitted here.
Various implementations of affine Inter mode and affine Merge mode have been discussed, for example, an affine flag is used to indicate whether the affine Inter mode is applied, and this affine flag is signaled for each Inter-coded coding unit (CU) when the CU is equal to or larger than 16×16. A candidate motion vector predictor (MVP) pair list is constructed for a current CU using valid neighboring coded blocks if the current CU is coded or to be coded in affine Inter mode. FIG. 2 illustrates an example of the candidate MVP pair derivation for a current block 20 coded in affine Inter mode or affine Merge mode. As shown in FIG. 2, a motion vector predictor (MVP) for the motion vector Mv0 at an upper-left control point of the current block 20 is selected from motion vectors of upper-left neighboring coded blocks A0, A1, or A2; and a MVP for Mv1 at an upper-right control point of the current block 20 is selected from motion vectors of upper-right neighboring coded blocks B0 and B1. An MVP index for the candidate MVP pair list is signaled in a video bitstream and motion vector differences (MVDs) of the two control points are coded in the video bitstream.
For a current block 20 coded in Merge mode, five neighboring coded sub-blocks C0 (referred as the left-bottom block), B0 (referred as the top-right block), B (referred as the upper-right corner block), C1 (referred as the lower-left corner block), and A0 (referred as the upper-left corner block) in FIG. 2 are sequentially checked to determines whether any of the neighboring coded sub-blocks is coded in affine Inter mode or affine Merge mode. The current block 20 in this example is a prediction unit (PU). An affine flag is signaled to indicate whether the current block 20 is coded in affine Merge mode only if any of the neighboring coded sub-blocks is coded in affine Inter mode or affine Merge mode. When encoding or decoding the current block 20 according to affine Merge mode, a first available affine-coded neighboring block is determined by selecting from the five neighboring coded sub-blocks. The first available affine-coded neighboring block including the selected neighboring coded sub-block is used to derive an affine Merge candidate. The affine Merge candidate is used for deriving a predictor in a reference picture for the current block. The selection order for selecting one of the neighboring coded sub-blocks is from left-bottom block, top-right block, upper-right corner block, lower-left corner block to upper-left corner block (C0→B→B1→C1→A0) as shown in FIG. 2. The affine Merge candidate for the current block 20 is derived from MVs at the control points of the first available affine-coded neighboring block, for example, the MVs of a top-left N×N sub-block and a top-right N×N sub-block of the first available affine-coded neighboring block are used to derive the affine Merge candidate if a four-parameter affine motion model is applied. The MV of a bottom-left N×N sub-block of the first available affine-coded neighboring block is also used to derive the affine Merge candidate when a third control point is included for a six-parameter affine motion model.